/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ChatView.java
 *
 * Created on Mar 27, 2011, 10:56:38 PM
 */

package vn.support.ui.frame;

import java.awt.event.ActionEvent;
import java.io.File;
import java.io.PrintWriter;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JOptionPane;
import javax.swing.JToolBar.Separator;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.text.EditorKit;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLEditorKit;
import vn.support.connection.Connection;
import vn.support.connection.response.processor.ResponseProcessor;
import vn.support.core.dto.ChatInfo;
import vn.support.core.dto.DataObject;
import vn.support.system.SystemProperties;
import vn.support.ui.action.ControlAction;

/**
 *
 * @author nttuyen
 */
public final class ChatViewFrame extends AbstractChatView {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
    
    private long lastSentUserTypingTime = 0;
    
	/** Creates new form ChatView */
    public ChatViewFrame(ChatInfo chatInfo) {
        super(chatInfo);
        
        initComponents();
        this.init();
        this.refresh();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jToolBarControlChat = new javax.swing.JToolBar();
        jToolBarChatInfo = new javax.swing.JToolBar();
        jScrollPaneChatContent = new javax.swing.JScrollPane();
        jTextPaneChatContent = new javax.swing.JTextPane();
        jToolBarMessageControl = new javax.swing.JToolBar();
        jPanelMessage = new javax.swing.JPanel();
        jScrollPaneMessage = new javax.swing.JScrollPane();
        jTextAreaMessage = new javax.swing.JTextArea();
        jButtonSend = new javax.swing.JButton();
        jPanelChatInfo = new javax.swing.JPanel();
        jLabelFullNameTitle = new javax.swing.JLabel();
        jLabelEmailTitle = new javax.swing.JLabel();
        jLabelEmail = new javax.swing.JLabel();
        jLabelDepartmentTitle = new javax.swing.JLabel();
        jLabelDepartment = new javax.swing.JLabel();
        jLabelFullName = new javax.swing.JLabel();
        jToolBarChatResponse = new javax.swing.JToolBar();
        jLabelChatResponse = new javax.swing.JLabel();
        jMenuBar = new javax.swing.JMenuBar();

        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentHidden(java.awt.event.ComponentEvent evt) {
                formComponentHidden(evt);
            }
        });

        jToolBarControlChat.setRollover(true);

        jToolBarChatInfo.setRollover(true);

        jScrollPaneChatContent.setViewportView(jTextPaneChatContent);

        jToolBarMessageControl.setRollover(true);

        jTextAreaMessage.setColumns(20);
        jTextAreaMessage.setRows(3);
        jTextAreaMessage.setTabSize(4);
        jTextAreaMessage.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jTextAreaMessageKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextAreaMessageKeyReleased(evt);
            }
        });
        jScrollPaneMessage.setViewportView(jTextAreaMessage);

        jButtonSend.setText("Send");
        jButtonSend.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSendActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelMessageLayout = new javax.swing.GroupLayout(jPanelMessage);
        jPanelMessage.setLayout(jPanelMessageLayout);
        jPanelMessageLayout.setHorizontalGroup(
            jPanelMessageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelMessageLayout.createSequentialGroup()
                .addComponent(jScrollPaneMessage, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButtonSend, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanelMessageLayout.setVerticalGroup(
            jPanelMessageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPaneMessage, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jButtonSend, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jLabelFullNameTitle.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelFullNameTitle.setText("Full Name:");

        jLabelEmailTitle.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelEmailTitle.setText("E - mail:");

        jLabelEmail.setText("nttuyen_it@yahoo.com");

        jLabelDepartmentTitle.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabelDepartmentTitle.setText("Department:");

        jLabelDepartment.setText("Demo");

        jLabelFullName.setText("Nguy?n Th? Tuy?n");

        javax.swing.GroupLayout jPanelChatInfoLayout = new javax.swing.GroupLayout(jPanelChatInfo);
        jPanelChatInfo.setLayout(jPanelChatInfoLayout);
        jPanelChatInfoLayout.setHorizontalGroup(
            jPanelChatInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelChatInfoLayout.createSequentialGroup()
                .addGroup(jPanelChatInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelDepartmentTitle)
                    .addComponent(jLabelFullNameTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelEmailTitle))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelChatInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelChatInfoLayout.createSequentialGroup()
                        .addComponent(jLabelEmail)
                        .addContainerGap())
                    .addGroup(jPanelChatInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanelChatInfoLayout.createSequentialGroup()
                            .addComponent(jLabelFullName, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap())
                        .addGroup(jPanelChatInfoLayout.createSequentialGroup()
                            .addComponent(jLabelDepartment, javax.swing.GroupLayout.DEFAULT_SIZE, 186, Short.MAX_VALUE)
                            .addContainerGap(169, Short.MAX_VALUE)))))
        );
        jPanelChatInfoLayout.setVerticalGroup(
            jPanelChatInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelChatInfoLayout.createSequentialGroup()
                .addGroup(jPanelChatInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelFullNameTitle)
                    .addComponent(jLabelFullName))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelChatInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelEmail)
                    .addComponent(jLabelEmailTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelChatInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelDepartmentTitle)
                    .addComponent(jLabelDepartment)))
        );

        jToolBarChatResponse.setRollover(true);

        jLabelChatResponse.setText("Response");
        jToolBarChatResponse.add(jLabelChatResponse);

        setJMenuBar(jMenuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jToolBarControlChat, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE)
            .addComponent(jScrollPaneChatContent, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE)
            .addComponent(jToolBarChatInfo, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE)
            .addComponent(jToolBarMessageControl, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelChatInfo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jPanelMessage, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jToolBarChatResponse, javax.swing.GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBarControlChat, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jToolBarChatInfo, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelChatInfo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPaneChatContent, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jToolBarMessageControl, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanelMessage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(1, 1, 1)
                .addComponent(jToolBarChatResponse, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonSendActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSendActionPerformed
        String message = this.jTextAreaMessage.getText();
        this.jTextAreaMessage.setText("");
        this.send(message);
    }//GEN-LAST:event_jButtonSendActionPerformed

    private void jTextAreaMessageKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextAreaMessageKeyPressed
        int keyCode = evt.getKeyCode();
        if(keyCode == 10 || keyCode == 13) {
            String message = this.jTextAreaMessage.getText();
            this.send(message);
            this.jTextAreaMessage.setText("");
        }
    }//GEN-LAST:event_jTextAreaMessageKeyPressed

    private void jTextAreaMessageKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextAreaMessageKeyReleased
        int keyCode = evt.getKeyCode();
        if(keyCode == 10 || keyCode == 13) {
            this.jTextAreaMessage.setText("");
        } else {
            if(System.currentTimeMillis() - this.lastSentUserTypingTime > 5000) {
                this.lastSentUserTypingTime = System.currentTimeMillis();
                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        DataObject sendData = new DataObject(Connection.USER_TYPING_ACTION);
                        sendData.set("sessionid", session.getSessionId());
                        sendData.set("chatsessionid", chatInfo.getChatSessionId());
                        sendData.set(Connection.RESPONSE_PROCESSOR, null);
                        connection.execute(sendData);
                    }
                }).start();
            }
        }
    }//GEN-LAST:event_jTextAreaMessageKeyReleased

    private void formComponentHidden(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentHidden
        this.endChatTimer.start();
    }//GEN-LAST:event_formComponentHidden

    @Override
    public void addMessage(String message) {
        try {
            EditorKit editorKit = this.jTextPaneChatContent.getEditorKit();
            if(editorKit instanceof HTMLEditorKit) {
                HTMLEditorKit htmlEditor = (HTMLEditorKit)editorKit;
                HTMLDocument document = (HTMLDocument) this.jTextPaneChatContent.getDocument();
                htmlEditor.insertHTML(document, document.getEndPosition().getOffset() - 1, message, 1, 0, null);
                this.jTextPaneChatContent.setCaretPosition(document.getLength());
            }
        } catch (Exception e) {}
    }

    @Override
    public void chatNotify(String message) {
        this.jLabelChatResponse.setText(message);
    }
    
    protected void init() {
        Action action = null;
        //Chat leave action
        action = new AbstractAction(this.bundle("ui.chat.control.action.leave")) {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        };
        ActionManager.set(getClass().getName() + "#chat.control.leave", action);
        this.jToolBarControlChat.add(action);
        this.jToolBarControlChat.add(new Separator());

        //Chat save action
        action = new AbstractAction(this.bundle("ui.chat.control.action.save")) {
            @Override
            public void actionPerformed(ActionEvent e) {
                JFileChooser fileChooser = new JFileChooser();
                FileFilter filter = new FileNameExtensionFilter("HTML file", "html");
                fileChooser.setFileFilter(filter);
                int returnVar = fileChooser.showSaveDialog(null);
                if(returnVar == JFileChooser.APPROVE_OPTION) {
                    File file = fileChooser.getSelectedFile();
                    try {
                        PrintWriter out = new PrintWriter(file);
                        String content = jTextPaneChatContent.getText();
                        out.println(content);
                        out.flush();
                        out.close();
                    } catch (Exception ex) {
                        Logger.getLogger(ChatViewFrame.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }
        };
        action.putValue(Action.SMALL_ICON, SystemProperties.getIcon("support.chat.control.content.save.icon"));
        ActionManager.set(getClass().getName() + "#chat.control.save", action);
        this.jToolBarControlChat.add(action);

        //Chat email action
        action = new AbstractAction(bundle("ui.chat.control.action.email")) {
            @Override
            public void actionPerformed(ActionEvent e) {
                //Email action
                String email = JOptionPane.showInputDialog(bundle("ui.chat.input.email"), "yourmail@domain.com");
                DataObject emailChat = new DataObject(Connection.EMAIL_CHAT_ACTION);
                emailChat.set("sessionid", session.getSessionId());
                emailChat.set("chatsessionid", chatInfo.getChatSessionId());
                emailChat.set("emailaddress", email);
                emailChat.set(Connection.RESPONSE_PROCESSOR, new ResponseProcessor() {
                    @Override
                    public DataObject process(DataObject data) {
                        return data;
                    }
                });
                connection.execute(emailChat);
            }
        };
        action.putValue(Action.SMALL_ICON, new ImageIcon(getClass().getResource("/image/mail-icon.png")));
        ActionManager.set(getClass().getName() + "#chat.control.email", action);
        this.jToolBarControlChat.add(action);
        
        //Chat print action
        action = new ControlAction(bundle("ui.chat.control.action.print"), new ImageIcon(getClass().getResource("/image/printButton.png")));
        ActionManager.set(getClass().getName() + "#chat.control.print", action);
        this.jToolBarControlChat.add(action);
        this.jToolBarControlChat.add(new Separator());
        
        //Chat canned action
        action = new AbstractAction(bundle("ui.chat.control.action.canned")) {
            @Override
            public void actionPerformed(ActionEvent e) {
                
            }
        };
        ActionManager.set(getClass().getName() + "#chat.control.canned", action);
        this.jToolBarControlChat.add(action);

        //Cut option
        action = new AbstractAction(bundle("ui.chat.message.control.cut")) {
            @Override
            public void actionPerformed(ActionEvent e) {
                jTextAreaMessage.cut();
            }
        };
        action.putValue(Action.SMALL_ICON, new ImageIcon(getClass().getResource("/image/Cut-silk.png")));
        ActionManager.set(getClass().getName() + "#chat.message.cut", action);
        this.jToolBarMessageControl.add(action);

        //Copy action
        action = new AbstractAction(bundle("ui.chat.message.control.copy")) {
            @Override
            public void actionPerformed(ActionEvent e) {
                jTextAreaMessage.copy();
            }
        };
        action.putValue(Action.SMALL_ICON, new ImageIcon(getClass().getResource("/image/copy_paste.png")));
        ActionManager.set(getClass().getName() + "#chat.message.copy", action);
        this.jToolBarMessageControl.add(action);

        //Paste action
        action = new AbstractAction(bundle("ui.chat.message.control.paste")) {
            @Override
            public void actionPerformed(ActionEvent e) {
                jTextAreaMessage.paste();
            }
        };
        action.putValue(Action.SMALL_ICON, new ImageIcon(getClass().getResource("/image/gtk-paste.png")));
        ActionManager.set(getClass().getName() + "#chat.message.paste", action);
        this.jToolBarMessageControl.add(action);
        
        this.jTextPaneChatContent.setEditable(false);
        this.jTextPaneChatContent.setEditorKit(new HTMLEditorKit());
        this.jToolBarControlChat.setFloatable(false);
        this.jToolBarChatInfo.setFloatable(false);
        this.jToolBarMessageControl.setFloatable(false);
        this.jTextAreaMessage.setLineWrap(true);
        
        //Menu
        jMenuFile = new JMenu(bundle("ui.chat.menu.file.name"));
        action = new AbstractAction(bundle("ui.chat.menu.file.clear")) {
            @Override
            public void actionPerformed(ActionEvent e) {
                jTextPaneChatContent.setText("");
            }
        };
        ActionManager.set(getClass().getName() + "#menu.file.clear", action);
        jMenuFile.add(action);
        jMenuFile.add(new javax.swing.JPopupMenu.Separator());
        action = new AbstractAction(bundle("ui.chat.menu.file.leave")) {
            @Override
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        };
        ActionManager.set(getClass().getName() + "#menu.file.leave", action);
        jMenuFile.add(action);
        this.jMenuBar.add(jMenuFile);
    }

    @Override
    public void refresh() {
        this.bundle = ResourceBundle.getBundle(UI_BUNDLE);
        
        //Window title
        this.setTitle(bundle("ui.chat.frame.title") + " - " + chatInfo.getFullName());

        //JToolBarChatInfo
        this.jToolBarChatInfo.removeAll();
        this.jToolBarChatInfo.add(new JLabel(bundle("ui.chat.info.chat")));

        //ChatInfo
        this.jLabelFullNameTitle.setText(bundle("ui.chat.chatinfo.fullname"));
        this.jLabelFullName.setText(this.chatInfo.getFullName());
        this.jLabelEmailTitle.setText(bundle("ui.chat.chatinfo.email"));
        this.jLabelEmail.setText(this.chatInfo.getEmail());
        this.jLabelDepartmentTitle.setText(bundle("ui.chat.chatinfo.department"));
        this.jLabelDepartment.setText(this.chatInfo.getDepartment());

        //Chat control action
        ActionManager.get(getClass().getName() + "#chat.control.leave").putValue(Action.NAME, bundle("ui.chat.control.action.leave"));
        ActionManager.get(getClass().getName() + "#chat.control.save").putValue(Action.NAME, bundle("ui.chat.control.action.save"));
        ActionManager.get(getClass().getName() + "#chat.control.email").putValue(Action.NAME, bundle("ui.chat.control.action.email"));
        ActionManager.get(getClass().getName() + "#chat.control.print").putValue(Action.NAME, bundle("ui.chat.control.action.print"));
        ActionManager.get(getClass().getName() + "#chat.control.canned").putValue(Action.NAME, bundle("ui.chat.control.action.canned"));
        ActionManager.get(getClass().getName() + "#chat.message.cut").putValue(Action.NAME, bundle("ui.chat.message.control.cut"));
        ActionManager.get(getClass().getName() + "#chat.message.copy").putValue(Action.NAME, bundle("ui.chat.message.control.copy"));
        ActionManager.get(getClass().getName() + "#chat.message.paste").putValue(Action.NAME, bundle("ui.chat.message.control.paste"));

        //Menu
        jMenuFile.setText(bundle("ui.chat.menu.file.name"));
        ActionManager.get(getClass().getName() + "#menu.file.clear").putValue(Action.NAME, bundle("ui.chat.menu.file.clear"));
        ActionManager.get(getClass().getName() + "#menu.file.leave").putValue(Action.NAME, bundle("ui.chat.menu.file.leave"));
        repaint();
    }
    
    private JMenu jMenuFile;


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonSend;
    private javax.swing.JLabel jLabelChatResponse;
    private javax.swing.JLabel jLabelDepartment;
    private javax.swing.JLabel jLabelDepartmentTitle;
    private javax.swing.JLabel jLabelEmail;
    private javax.swing.JLabel jLabelEmailTitle;
    private javax.swing.JLabel jLabelFullName;
    private javax.swing.JLabel jLabelFullNameTitle;
    private javax.swing.JMenuBar jMenuBar;
    private javax.swing.JPanel jPanelChatInfo;
    private javax.swing.JPanel jPanelMessage;
    private javax.swing.JScrollPane jScrollPaneChatContent;
    private javax.swing.JScrollPane jScrollPaneMessage;
    private javax.swing.JTextArea jTextAreaMessage;
    private javax.swing.JTextPane jTextPaneChatContent;
    private javax.swing.JToolBar jToolBarChatInfo;
    private javax.swing.JToolBar jToolBarChatResponse;
    private javax.swing.JToolBar jToolBarControlChat;
    private javax.swing.JToolBar jToolBarMessageControl;
    // End of variables declaration//GEN-END:variables

}
